//#include "list.hpp"
#include <iostream>
#include <list>
using namespace std;
void print(const list<int> &lt)
{
    auto it = lt.begin();
    while (it != lt.end())
    {
        cout << *it << " ";
        ++it;
    }
    cout << endl;
}
void test()
{
    list<int> lt;
    lt.push_back(1);
    lt.push_back(2);
    lt.push_back(3);
    lt.push_back(4);
    lt.push_back(5);
    lt.push_back(6);
    list<int>::iterator it = lt.begin();
    while (it != lt.end())
    {
        if (*it % 2 == 0)
        {
            it = lt.erase(it);
        }
        else
        {
            ++it;
        }
    }
    print(lt);
}
void test1()
{
    list<int> lt;
    lt.push_back(-1);
    lt.push_back(0);
    lt.push_back(1);
    lt.push_back(2);
    lt.push_back(3);
    lt.push_back(4);
    lt.push_back(5);
    lt.push_back(6);
    auto it = lt.begin();
    while(it != lt.end())
    {
        cout<<*it<<" ";
        ++it;
        lt.insert(it,-2);
    }
    cout<<endl;
}
int main()
{
    // xzq::test();
    // xzq::test1();
    // xzq::test2();
    //test();
    test1();
    return 0;
}